@layout("/common/_container.html"){
<div>推荐人页面</div>
<!--<label><input class="ipt" type="radio" value="asp" name="me" />asp</label>-->
<input id="name" name="姓名" value=""/>
<input type="button" value="搜索" id="search" />
<div class="content"></div>
<input type="button" value="提交" id="submit" />

<style>
    #chils{
        display: inline-block;
        width: 30%;
    }
</style>

<link rel="stylesheet" href="${ctxPath}/static/css/jqui/jquery-ui.min.css">
<script src="${ctxPath}/static/js/jquery-ui.min.js"></script>
<script src="${ctxPath}/static/modular/tcCenter/consultant/consultant_info.js"></script>
<script>
    //把数据渲染到archiving_content容器里面
    var search = document.getElementById("search");
    var dom = document.getElementsByClassName('content')[0];
    search.onclick = function(){
        dom.innerHTML='';
        $.ajax({
            url: Feng.ctxPath + "/customer/getReferee",
            type: "post",
            data: {
                "name":document.getElementById("name").value
            },
            success: function (data) {
                var fragment = document.createDocumentFragment();
                var ul = document.createElement("ul");
                var listr = '';
                for(var i=0;i<data.length;i++){
                    listr = "<li id='chils'><label><input class='ipt' type='radio' value='"+data[i].account+"' name='me' />"+data[i].account+"</label></li>";
                }
                ul.innerHTML = listr;
                fragment.appendChild(ul);
                dom.appendChild(fragment);
            },
            error: function (data) {
                alert('内部故障!');
            }
        });
    }

    var radio = document.getElementsByClassName('ipt');
    var submit = document.getElementById("submit");
    var isChecked=0;
    submit.onclick = function(){
        var dom =parent.document.getElementById('referee');//访问父页面元素值
        for(var i=0;i<radio.length;i++){
            if(radio[i].checked){
                isChecked++;
                dom.value = radio[i].value;
            }
        }
        if(isChecked==0){
            dom.value ='';
        }
        var indexs = parent.layer.getFrameIndex(window.name);
        parent.layer.close(indexs)
    }
</script>
@}
